package org.feng.customlog.config;

import org.feng.customlog.entity.CustomLogProperties;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

/**
 * 自定义日志自动配置类
 *
 * @version v1.0
 * @author: fengjinsong
 * @date: 2023年06月05日 16时19分
 */
@AutoConfiguration
public class CustomLogAutoConfiguration {

    @Value("${org.feng.enableCustomLog:false}")
    private Boolean enableCustomLog;

    @Bean
    public CustomLogProperties customLogProperties() {
        CustomLogProperties customLogProperties = new CustomLogProperties();
        customLogProperties.setEnableCustomLog(this.enableCustomLog);
        return customLogProperties;
    }
}
